package work.timejay.service.impl;

import org.yaml.snakeyaml.events.Event;
import work.timejay.entity.CopyBooksCatalogue;
import work.timejay.mapper.CopyBooksCatalogueMapper;
import work.timejay.service.CopyBooksCatalogueService;
import work.timejay.common.SuperServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 采集结果集表 服务实现类
 * </p>
 *
 * @author 王文杰
 * @since 2023-12-09
 */
@Service
public class CopyBooksCatalogueServiceImpl extends SuperServiceImpl<CopyBooksCatalogueMapper, CopyBooksCatalogue> implements CopyBooksCatalogueService {

    @Override
    public List<CopyBooksCatalogue> findInfoList() {
        return lambdaQuery()
                .eq(CopyBooksCatalogue::getHandlerStatus, 0)
                .list();
    }

    @Override
    public CopyBooksCatalogue findInfoById(String id) {
        return baseMapper.selectById(id);
    }

    @Override
    public void updateHandlerStatusAll(boolean flag) {
        lambdaUpdate()
                .set(CopyBooksCatalogue::getHandlerStatus,flag)
                .update();
    }
}
